/**
 * string() 值必须是字符串
 * alphanum() 值只能是包含 a-zA-Z0-9 的字符串
 * min(length) 最小长度
 * max(length) 最大长度
 * required() 值是必填项，不能为 undefined
 * pattern(正则表达式) 值必须符合正则表达式的规则
 */

const joi = require('joi')

// 轮播图类型
const type = joi.number().required();
const id = joi.number().required();

const sort_count = joi.string().allow(null, '');
const url = joi.string().allow(null, '');

const file = joi.any().required();


exports.swiper_update_type = {
    body:{
        type,
        url,
        id
    }
}

exports.swiper_upLoad = {
    body:{
        sort_count,
        url
    },
    file
}

exports.swiper_delete = {
    body: {
        id
    }
}
